Devices used to surf the web come in all shapes and sizes. Because of the development of wireless and cellular networks, many people use mobile devices, e.g., cell phones, personal digital assistants (PDAs), smart phones, tablets, etc., to access websites over the Internet. However, the physical characteristics and technical capabilities may vary among mobile devices and between mobile devices and traditional computers, such as desktops or laptops. Because of these differences, a website that is meant to be displayed on a desktop or laptop may be difficult or impossible to view on a PDA or smart phone. Thus, some organizations offer mobile versions of their websites that are altered to display properly on a mobile device. For example, an organization with a website hosted at the domain name, “example.com,” may also have a mobile version of the same website hosted at the domain name, “m.example.com.” HTTP requests made to m.example.com may be served with simplified versions of web pages designed to render appropriately on mobile devices.
However, mobile device users may not know or bother to request mobile versions of websites by entering mobile-specific domain names on their mobile devices, but instead may enter more familiar, general website domain names. Thus, it may be beneficial for owners of websites to be able to automatically detect when a user is making a request from a mobile device in order to automatically provide the user with a mobile version of the website.
One way of determining whether a user is accessing a website using a mobile device is by examining a user agent string. Specifically, when a client makes an HTTP request, the HTTP request may include a “User-Agent” field as an HTTP header. The User-Agent field may identify, for example, the type of device and/or browser that the client is using. Then, one or more server-side scripts to which the HTTP request object is passed from the web server application may compare the User-Agent field to a list of user agent strings typically associated with mobile devices to determine if the device is a mobile device. For example, databases such as the Wireless Universal Resource File (WURFL) contain listings of user agent strings associated with various devices, as well as the capabilities of such devices. Server-side scripts may make use of such databases to determine whether a given HTTP request originates from a mobile device by comparing the User-Agent field of the HTTP request with one or more user agent strings of the database. However, in order to ensure comprehensiveness across all or nearly all known devices, such databases may be enormous, making the comparison resource-intensive for server-side scripts. Moreover, it may be necessary to continually update such databases to ensure that they account for all mobile devices, as new user agent strings or mobile devices arise.
Traditionally, server-side scripts perform any mobile device detection. When a web server hosting a website receives an HTTP request, the web server application handles basic HTTP operations, constructs an HTTP request object, and then forwards the HTTP request object to any server-side scripts responsible for dynamically rendering the web pages on the website. It is these server-side scripts that typically are responsible for comparing the User-Agent field of the HTTP request to the entries in the WURFL or other database. Thus, the HTTP request must undergo significant processing before it is even known whether the client is a mobile device. Therefore, there is a need for systems and methods of enabling a web server to quickly determine whether an HTTP request originates from a mobile device before the HTTP request undergoes significant processing or forwarding to any server-side scripts. There is also a need for systems and methods of mobile device detection that obviate the need to search through large user agent string databases to determine whether an HTTP request originates from a mobile device and that enable may be easily and frequently updated to account for new devices or user agent strings without significant processing or memory overhead.